Some tasks such as encoding or decoding a serial data stream or cycle sensitive state machines, cannot be done at a sufficiently high performance level in software. Therefore, often encoders, decoders and state machines are implemented in hardware to improve performance. But in systems where behavioral flexibility is required, the hardwired approach is not useful and it is desirable to have a programmable state machine.
It has become customary to classify state machines into one of two types. The first, the Moore machine, generates next state conditions based solely on present state conditions. The Mealy machine, by contrast, generates next state conditions based both on present state conditions and the state of a set of input data values.